package com.jt9003.utils;

import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


/**
 * 定时任务
 */
@Component
@EnableScheduling   //开启定时任务
public class Time {

    /**
     * 定时刷新就诊人数
     * 每天凌晨6点刷新就诊人数
     */
    @Scheduled(cron = "00 00 06 ? * *")
    public void timing(){
        P_NamberUtil.amPatientNambers = 0;
        P_NamberUtil.pmPatientNambers = 0;
        P_NamberUtil.nightPatientNambers = 0;
        P_NamberUtil.orderPatientNambers = 0;
        System.out.println("刷新当前就诊人数");
    }

}
